<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/content/mytags.jsp"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>未授权用户列表</title>
		<t:resource types="jquery,lhgdialog,easyui" />
	</head>
	<body>
		<ui:datagrid name="nonGrantUserList" title="用户列表" action="user.do?non-exist-users-role-datagrid&roleId=${roleId }" idField="id" checkbox="true">
			<ui:column title="编号" field="id" hidden="true" />
			<ui:column title="用户账号" field="userAccount" query="true" />
			<ui:column title="用户姓名" field="userName" />
			<ui:column title="用户状态" field="state" dictionary="userState" />
			<ui:column title="备注" field="remark" />
		</ui:datagrid>
		<ui:form name="user-grant-form" action="role.do?roleGrantUser&roleId=${roleId }" refreshGrid="usersInRoleList" onSubmit="setUserId">
			<input id="userId" name="userId" type="hidden" value="">
		</ui:form>
	</body>
	<script type="text/javascript">
		function setUserId() {
			var selectRows = nonGrantUserListGetSelectRows();
			if(selectRows.length != 1) {
				msgTip('请选择一个要授权的用户！');
				return false;
			}
			$('#userId').val(selectRows[0]['id']);
			return true;
		}
	</script>
</html>